package com.wz.project.cxtj.inOrder.service.impl;

import com.wz.common.utils.DateUtils;
import com.wz.common.utils.text.Convert;
import com.wz.project.cxtj.inOrder.domain.ViewInOrder;
import com.wz.project.cxtj.inOrder.mapper.ViewInOrderMapper;
import com.wz.project.cxtj.inOrder.service.IViewInOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 入库流水Service业务层处理
 * 
 * @author wz
 * @date 2022-05-19
 */
@Service
public class ViewInOrderServiceImpl implements IViewInOrderService 
{
    @Autowired
    private ViewInOrderMapper viewInOrderMapper;

    /**
     * 查询入库流水
     * 
     * @param jobId 入库流水ID
     * @return 入库流水
     */
    @Override
    public ViewInOrder selectViewInOrderById(String jobId)
    {
        return viewInOrderMapper.selectViewInOrderById(jobId);
    }

    /**
     * 查询入库流水列表
     * 
     * @param viewInOrder 入库流水
     * @return 入库流水
     */
    @Override
    public List<ViewInOrder> selectViewInOrderList(ViewInOrder viewInOrder)
    {
        return viewInOrderMapper.selectViewInOrderList(viewInOrder);
    }

    /**
     * 新增入库流水
     * 
     * @param viewInOrder 入库流水
     * @return 结果
     */
    @Override
    public int insertViewInOrder(ViewInOrder viewInOrder)
    {
        viewInOrder.setCreateTime(DateUtils.getNowDate());
        return viewInOrderMapper.insertViewInOrder(viewInOrder);
    }

    /**
     * 修改入库流水
     * 
     * @param viewInOrder 入库流水
     * @return 结果
     */
    @Override
    public int updateViewInOrder(ViewInOrder viewInOrder)
    {
        return viewInOrderMapper.updateViewInOrder(viewInOrder);
    }

    /**
     * 删除入库流水对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteViewInOrderByIds(String ids)
    {
        return viewInOrderMapper.deleteViewInOrderByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除入库流水信息
     * 
     * @param jobId 入库流水ID
     * @return 结果
     */
    @Override
    public int deleteViewInOrderById(String jobId)
    {
        return viewInOrderMapper.deleteViewInOrderById(jobId);
    }
}
